Imports GSALib

Partial Class _Default
    Inherits System.Web.UI.Page

    Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim q As New GSALib.GSA.Query
        Dim collections(0) As String
        collections(0) = "default_collection"
        q.setSiteCollections(collections)
        q.setFrontend("default_frontend")
        q.setOutputFormat(GSALib.Constants.Output.XML_NO_DTD)
        q.setOutputEncoding(GSALib.Constants.Encoding.UTF8)
        q.setAccess(GSALib.Constants.Access.PUBLIC)
        q.setMaxResults(15)
        Dim term As New GSALib.GSA.QueryTerm("rio")
        q.setQueryTerm(term)
        Dim ca As New GSALib.GSA.ClientAccess()

        'ca.credentails = new System.Net.NetworkCredential("", "", "");  //Use only for secure and ALL access modes

        Dim Value As String
        Value = q.getValue()

        Try
            Dim res As GSALib.GSA.Response
            res = ca.getGSAResponse(q, Nothing)
            Response.Write(res.getNumResults)
        Catch ex As GSALib.Exceptions.GSANeedNetworkCredentailsException
            Response.Write(ex.Message)
        End Try


    End Sub
End Class
